package Backend;

/* @author dara */

public class Album{
  private Song[] songs;
  private String title;
  
  /* 
   * @param  title  title of the song
   * @param  songs  array of songs to pass in to album 
   */
  public Album(String title, Song[] songs){
    this.songs = songs;
    this.title = title;
  }  
  
  public String toString(){
    String list = title + "\n";
    for(int i = 0; i < songs.length; i++){
      list = list + "  " + songs[i] + "\n";
    }
    return list;
  }
  
  public String getTitle(){
    return title;
  }
  
  public Song[] getSongs(){
    return songs;
  }
  
  public Song getSong(int i){
    if(i < 0 || i >= songs.length){
      return null;
    }
    return songs[i];
  }
  
}

